/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package se392.ateam2006.resourcemgmt.equipment;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import se392.ateam2006.resourcemgmt.room.RoomEntity;

/**
 *
 * @author Sam
 */

public class EquipmentEntityPK implements Serializable {
    
    
    public String id;
    
    public String roomId;
    
    public EquipmentEntityPK(){
        
    }
    
    public EquipmentEntityPK(String id, String roomId){
        this.id = id;
        this.roomId = roomId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTheRoom() {
        return roomId;
    }

    public void setTheRoom(String roomId) {
        this.roomId = roomId;
    }
    
    @Override
    public boolean equals(Object obj){
        if(obj == this)return true;
        if(!(obj instanceof EquipmentEntityPK)) return false;
        EquipmentEntityPK pk = (EquipmentEntityPK) obj;
        if(!id.equals(pk.getId())) return false;
        if(!roomId.equals(pk.getTheRoom())) return false;
        return true;
    }
    
    @Override
    public int hashCode(){
        return id.hashCode() + roomId.hashCode();
    }
}
